import java.util.Scanner;

public class NarcissisticNumber {
    //判断一个数是否为水仙花数
    public static void main(String[] args) {
        Scanner sc=new Scanner(System.in);
        int num=sc.nextInt();
        if (num==(num/100)*(num/100)*(num/100)+(num/10%10)*(num/10%10)*(num/10%10)+(num%10)*(num%10)*(num%10))
            System.out.println(num+"是水仙花数");
        else
            System.out.println(num+"不是水仙花数");
    }


    //求100到999之间的水仙花数
    public static void main2(String[] args) {
        for (int i = 100; i <= 999; i++) {
            int tmp = i;//为了不改变i的值，从新定义一个变量
            int sum = 0;
            while(tmp != 0){
                //pow(x,y)是返回x的y次幂
                sum += Math.pow(tmp % 10,3);//求数字i上各位置的y次幂的和
                tmp /= 10;
            }
            if(sum == i){
                System.out.println(i);
            }
        }
    }
    //自幂数（去百度百科）
    public static void main1(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int n = scanner.nextInt();
        for (int i = 0; i <= n; i++) {
            //首先判断i是几位数
            //其次求每一位上的数字
            int count = 0;
            int tmp = i;
            while(tmp != 0){
                count++;
                tmp = tmp / 10;
            }
            tmp = i;
            int sum = 0;
            while(tmp != 0){
                sum += Math.pow(tmp % 10,count);
                tmp /= 10;
            }
            if(sum == i){
                System.out.println(i);
            }
        }
    }
}
